home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 816 b | 36 lines | [TEXT/ttxt] |
- --<<<
- -- Kaleida Labs, Inc.
- -- Field Guide to the ScriptX Language
- -- chapter 1, example 3
-
- -- create a module so that names used earlier in the chapter do not
- -- conflict with names used here
-
- module Scratch1 uses ScriptX end
- in module Scratch1
-
- class Dog ()
- instance variables
- name, owner, breed, age, length, weight, sex, temperament
- instance methods
- method bark self -> print "makes a lot of noise"
- method fetch self -> print "fetches a stick"
- method sniff self -> print "sticks nose into things"
- end
-
- class HuntingHound (Dog)
- instance methods
- method bark self -> print "wooof, wooof"
- end
-
- class BassetHound (HuntingHound)
- instance methods
- method drool self -> print "slobbers all over everything"
- end
-
- object vaps (BassetHound)
- settings name:"Vaps", owner:"The Crosbys"
- end
-
- drool vaps
- -->>>